//3_6_2
// factorial iteraitve version
#include<iostream>
void factorial( int );

int main()
{
	int num=0;
	std::cout << "Enter n: ";
	std::cin >> num;
	factorial( num );
	return 0;
}
void factorial(int n)
{
	int fact = 1;
	if( n < 0 ){
		std::cout << "Enter possitive number: ";
	}
	else if( 0 == n ){
		fact = 1;
		std::cout << n << "!= " << fact << std::endl;
	} 
	else
	{
		for( int i = n; i >= 1; --i)
		{
			fact * = i;
		}
		std::cout << n << "!= " << fact << std::endl;
	}
}